print "enter a number:"
-- n = io.read()
-- if not n then
--     error "invalid input"
-- end
-- a = assert(io.read("*n"),"invalid input")
n = io.read()
assert(tonumber(n),"invalid input:" .. n .. "is not a number")
-- assert 成功返回值 错误抛出错误